﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Data.SqlClient;
using System.Text;

namespace loginWeb
{
    public partial class Login1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "修改密码仓库里改动";
            txtNewPwd.Focus();
            Label1.Text = "";
        }

        protected void txtName_TextChanged(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            StringBuilder sb = new StringBuilder(1024);
            sb.Append("UPDATE  Users1 ");
            sb.Append("SET         密码 = @密码 ");
            sb.Append("WHERE   (邮箱 = @邮箱) AND (登录名 = @登录名) ");

            
            SqlParameter[] pms = new SqlParameter[3];
            pms[0] = new SqlParameter("@密码", this.txtNewPwd.Text);
            pms[1] = new SqlParameter("@邮箱", this.txtQq.Text);
            pms[2] = new SqlParameter("@登录名", this.txtName.Text);


            int intResult = SqlHelper.ExecuteNonQuery(sb.ToString(), pms);
            this.Label1.Text = (intResult < 1) ? "请检查邮箱登录名是否错误" : "修改成功！";
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
           this.txtName.Text="";
           this.txtQq.Text="";
           this.txtNewPwd.Text = "";
           this.txtPwdAgain.Text = "";
           this.Label1.Text = "";

        }        
        
    }
}